﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using TYAJZWeb.Utils;
using TYAJZWeb.Models;

namespace TYAJZWeb.Controllers
{
    public class LogController : BaseController
    {
        [CookiesAuthorize]
        public ActionResult List(int page)
        {
            var r = Context.Logs.OrderByDescending(t => t.Id)
                .Select(t => (LogListModel)t);
            int totalCount = r.Count();
            r = r.Skip((page - 1) * PAGESIZE).Take(PAGESIZE);
            return View(new PageList<LogListModel>(r, page, PAGESIZE, totalCount));
        }

    }
}
